package com.zhao.modleclass.fragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.zhao.modleclass.Helper.FragmentHelper;
import com.zhao.modleclass.R;
import com.zhao.modleclass.adapter.HP_VPAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2016/12/5.
 */

public class HP_Fragment_Teacher extends Fragment {
    @Bind(R.id.vp_fg_hp)
    ViewPager vpFgHp;
    private List<Fragment> mList;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mList = new ArrayList<>();
        mList.add(new HP_Teacher_Left());
        mList.add(new HP_Teacher_Right());
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.vp_fragment_hp, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        HP_VPAdapter adapter=new HP_VPAdapter(getFragmentManager(),mList);
//      vpFgHp.setOffscreenPageLimit(1);
        vpFgHp.setAdapter(adapter);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
